/**
 * article模块接口列表
 */

import axios from '@/request/http'; // 导入http中创建的axios实例
import qs from 'qs'; // 根据需求是否导入qs模块

const student = {
    // getUpload(file) {
    //     let formData = new FormData();
    //     formData.append("file", file.blob();
    //     return axios.post(`/api/mobile/examine/upload/file`, formData, {
    //         headers: {
    //             'Content-Type': 'multipart/form-data'
    //         }
    //     });
    // },
    getSearch() {
        return axios.post(`/server/student/in/load/search`, {

        });
    },
    getSearchLeave() {
        return axios.post(`/server/student/leave/load/search`, {

        });
    },
    getGrade(schoolId) {
        return axios.post(`/server/common/load/grade`, {
            "schoolId": schoolId
        });
    },
    getClass(schoolId, gradeId) {
        return axios.post(`/server/common/load/class`, {
            "schoolId": schoolId,
            "gradeId": gradeId
        });
    },
    getInSchool(schoolId, gradeId, classId, studentName, identityCardNumber, sex, nation, subject, politicsFace, isResidence, isPoorStudent, studentStatusState, isLefBehindChildren, isMartyrOrCaressChildren, isOrphan, isDisability, fosterDirection, payCategory, isReread, isClassesDivide, isSpecialStudent, isUploadStudentHeadUrl, isGroup, page, size, exportType, fieldShow) {
        return axios.post(`/server/student/in/load/list`, {
            "schoolId": schoolId,
            "gradeId": gradeId,
            "classId": classId,
            "studentName": studentName,
            "identityCardNumber": identityCardNumber,
            "sex": sex,
            "nation": nation,
            "subject": subject,
            "politicsFace": politicsFace,
            "isResidence": isResidence,
            "isPoorStudent": isPoorStudent,
            "studentStatusState": studentStatusState,
            "isLefBehindChildren": isLefBehindChildren,
            "isMartyrOrCaressChildren": isMartyrOrCaressChildren,
            "isOrphan": isOrphan,
            "isDisability": isDisability,
            "fosterDirection": fosterDirection,
            "payCategory": payCategory,
            "isReread": isReread,
            "isClassesDivide": isClassesDivide,
            "exportType": exportType,
            "isGroup": isGroup,
            "page": page,
            "size": size,
            "fieldShow": fieldShow,
            "isSpecialStudent": isSpecialStudent,
            "isUploadStudentHeadUrl": isUploadStudentHeadUrl,
        });
    },
    getStudentView(studentId) {
        return axios.post(`/server/common/load/student/view`, {
            "studentId": studentId
        });
    },
    // getStudentDetails(studentId) {
    //     return axios.post(`/server/common/load/student/detail`, {
    //         "studentId": studentId
    //     });
    // },
    saveStudent(isGroup, flag, detail, fieldList) {
        return axios.post(`/server/student/in/save`, {
            "isGroup": isGroup ? "Y" : "N",
            "flag": flag,
            "detail": JSON.stringify(detail),
            "fieldList": JSON.stringify(fieldList),
        });
    },
    getStudentDetails(studentId) {
        return axios.post(`/server/common/load/student/detail`, {
            "studentId": studentId
        });
    },
    getDialogState(studentId) {
        return axios.post(`/server/student/in/load/student/state`, {
            "studentId": studentId
        });
    },
    SaveDialogState(studentId, isGroup, studentStateCode, applyRemark) {
        return axios.post(`/server/student/in/save/student/state`, {
            "studentId": studentId,
            "isGroup": isGroup,
            "studentStateCode": studentStateCode,
            "applyRemark": applyRemark
        });
    },
    getDialogSchool(studentId) {
        return axios.post(`/server/student/in/load/schools`, {
            "studentId": studentId
        });
    },
    SaveDialogSchool(studentId, isGroup, switchToSchoolId) {
        return axios.post(`/server/student/in/switch/to/school`, {
            "studentId": studentId,
            "isGroup": isGroup,
            "switchToSchoolId": switchToSchoolId,
        });
    },
    removeIn(studentId, isGroup, userCenterId) {
        return axios.post(`/server/student/in/delete`, {
            "studentId": studentId,
            "isGroup": isGroup,
            "userCenterId": userCenterId,
        });
    },
    removeInAll(studentIds, isGroup) {
        return axios.post(`/server/student/in/deleteAll`, {
            "studentIds": studentIds.toString(),
            "isGroup": isGroup
        });
    },
    getPhoto(studentId) {
        return axios.post(`/server/student/in/load/photo`, {
            "studentId": studentId,
        });
    },
    savePhoto(MultipartFile, studentId) {
        let params = new FormData();
        params.append("file", MultipartFile.raw);
        params.append("studentId", studentId);
        return axios.post(`/server/student/in/save/photo`, params, {
            headers: {
                'Content-Type': 'multipart/form-data'
            }
        });
    },
    reset(studentId) {
        return axios.post(`/server/common/init/pass`, {
            "studentId": studentId,
        });
    },
    batchPhoto(multipartFiles) {
        let params = new FormData();
        params.append("multipartFiles", multipartFiles.raw);
        return axios.post(`/server/student/in/import/photo`, params, {
            headers: {
                'Content-Type': 'multipart/form-data'
            }
        });
    },
    mySelect() {
        return axios.post(`/server/approval/my/load/search`, {
        });
    },
    myGetDate(approveTimeStart, approveTimeStop, approveType, page, size) {
        return axios.post(`/server/approval/my/load/list`, {
            "approveTimeStart": approveTimeStart,
            "approveTimeStop": approveTimeStop,
            "approveType": approveType,
            "page": page,
            "size": size,
        });
    },
    waitSelect() {
        return axios.post(`/server/approval/wait/load/search`, {
        });
    },
    waitGetDate(approvalStatus, approveTimeStart, approveTimeStop, approveType, schoolId, page, size) {
        return axios.post(`/server/approval/wait/load/list`, {
            "approvalStatus": approvalStatus,
            "approveTimeStart": approveTimeStart,
            "approveTimeEnd": approveTimeStop,
            "approvalType": approveType,
            "schoolId": schoolId,
            "page": page,
            "size": size,
        });
    },
    waitReview(approvalId, approveState, approveRemark) {
        return axios.post(`/server/approval/wait/save/result`, {
            "approvalId": approvalId,
            "approveState": approveState,
            "approveRemark": approveRemark,
        });
    },
    getLeaveSearch() {
        return axios.post(`/server/student/leave/load/search`, {
        });
    },
    getLeaveSchool(schoolId, studentName, finishSchoolYear, identityCardNumber, sex, nation, subject, politicsFace, isResidence, isPoorStudent, studentStatusState, isLefBehindChildren, isMartyrOrCaressChildren, isOrphan, isDisability, fosterDirection, payCategory, isReread, isClassesDivide, studentState, isSpecialStudent, isUploadStudentHeadUrl, isGroup, page, size, exportType) {
        return axios.post(`/server/student/leave/load/list`, {
            "schoolId": schoolId,
            "studentName": studentName,
            "finishSchoolYear": finishSchoolYear,
            "identityCardNumber": identityCardNumber,
            "sex": sex,
            "nation": nation,
            "subject": subject,
            "politicsFace": politicsFace,
            "isResidence": isResidence,
            "isPoorStudent": isPoorStudent,
            "studentStatusState": studentStatusState,
            "isLefBehindChildren": isLefBehindChildren,
            "isMartyrOrCaressChildren": isMartyrOrCaressChildren,
            "isOrphan": isOrphan,
            "isDisability": isDisability,
            "fosterDirection": fosterDirection,
            "payCategory": payCategory,
            "isReread": isReread,
            "isClassesDivide": isClassesDivide,
            "studentState": studentState,
            "exportType": exportType,
            "isGroup": isGroup, "page": page, "size": size, "isSpecialStudent": isSpecialStudent,
            "isUploadStudentHeadUrl": isUploadStudentHeadUrl,
        });
    },
    resumption(studentId, isGroup) {
        return axios.post(`/server/student/leave/resumption/student/status`, {
            "studentId": studentId,
            "isGroup": isGroup,
        });
    },
    getFinishSearch() {
        return axios.post(`/server/student/finish/load/search`, {
        });
    },
    getFinishSchool(schoolId, studentName, finishSchoolYear, identityCardNumber, sex, nation, subject, politicsFace, isResidence, isPoorStudent, studentStatusState, isLefBehindChildren, isMartyrOrCaressChildren, isOrphan, isDisability, fosterDirection, payCategory, isReread, isClassesDivide, studentState, isSpecialStudent, isUploadStudentHeadUrl, isGroup, page, size, exportType) {
        return axios.post(`/server/student/finish/load/list`, {
            "schoolId": schoolId,
            "studentName": studentName,
            "finishSchoolYear": finishSchoolYear,
            "identityCardNumber": identityCardNumber,
            "sex": sex,
            "nation": nation,
            "subject": subject,
            "politicsFace": politicsFace,
            "isResidence": isResidence,
            "isPoorStudent": isPoorStudent,
            "studentStatusState": studentStatusState,
            "isLefBehindChildren": isLefBehindChildren,
            "isMartyrOrCaressChildren": isMartyrOrCaressChildren,
            "isOrphan": isOrphan,
            "isDisability": isDisability,
            "fosterDirection": fosterDirection,
            "payCategory": payCategory,
            "isReread": isReread,
            "isClassesDivide": isClassesDivide,
            "studentState": studentState,
            "exportType": exportType,
            "isGroup": isGroup, "page": page, "size": size, "isSpecialStudent": isSpecialStudent,
            "isUploadStudentHeadUrl": isUploadStudentHeadUrl,
        });
    },
    update() {
        return axios.post(`/server/student/finish/generate/finish`, {})
    },
    classes() {
        return axios.post(`/server/divide/classes/load/left`, {})
    },
    classesList(gradeId, classId, studentName) {
        return axios.post(`/server/divide/classes/load/list`, {
            "gradeId": gradeId,
            "classId": classId,
            "studentName": studentName,
        })
    },
    assignmentClassExcel() {
        return axios.post(`/server/divide/classes/build/excel`, {})
    },
    log(operateTimeStart, operateTimeEnd, operateUserName, page, size) {
        return axios.post(`/server/operate/log/load/list`, {
            "operateTimeStart": operateTimeStart,
            "operateTimeEnd": operateTimeEnd,
            "operateUserName": operateUserName,
            "page": page, "size": size
        })
    },
    getSchoolCode(schoolName) {
        return axios.post(`/server/school/load/list`, {
            "schoolName": schoolName
        })
    },
    saveSchoolCode(schoolId, areaCode, area) {
        return axios.post(`/server/school/save`, {
            "schoolId": schoolId,
            "areaCode": areaCode,
            "area": area,
        })
    },
    getSectionCode() {
        return axios.post(`/server/school/load/section`, {
        })
    },
    roleList() {
        return axios.post(`/server/role/load/list`, {
        })
    },
    roleUser(roleId) {
        return axios.post(`/server/role/load/user`, {
            "roleId": roleId
        })
    },
    saveRole(roleId, direction, userIds) {
        return axios.post(`/server/role/save/user`, {
            "roleId": roleId,
            "direction": direction,
            "userIds": userIds.toString(),
        })
    },
    getFixedList() {
        return axios.post(`/server/student/field/fixed_field`, {
        })
    },
    getDiyList() {
        return axios.post(`/server/student/field/mapper`, {
        })
    },
    delDiy(id) {
        return axios.post(`/server/student/field/delete`, {
            "id": id
        })
    },
    addDiy(name, fieldType, id) {
        return axios.post(`/server/student/field/save`, {
            "name": name,
            "fieldType": fieldType,
            "id": id,
        })
    },
    importExcel(multipartFiles) {
        let params = new FormData();
        params.append("file", multipartFiles.raw);
        return axios.post(`/server/student/in/import/excel`, params, {
            headers: {
                'Content-Type': 'multipart/form-data'
            }
        });
    },
    assignmentClassUpload(multipartFiles) {
        let params = new FormData();
        params.append("file", multipartFiles.raw);
        return axios.post(`/server/divide/classes/import/excel`, params, {
            headers: {
                'Content-Type': 'multipart/form-data'
            }
        });
    }
}

export default student;